<template>
  <el-form ref="form" :model="form" label-width="80px" class="abnormal_notic_cmp">
    <div class="form_head">异常检测配置</div>
    <div>
      <div class="abnormal_info_config">
        <div class="abnormal_info_config_item">
          <el-form-item label="活动区域" size="mini">
            <el-select v-model="form.region" placeholder="请选择活动区域">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="活动区域" size="mini">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
          <el-form-item label="活动区域" size="mini">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
        </div>
      </div>
    </div>
    <div>
      <div class="abnormal_info_notice">
        <el-table :data="tableData" border style="width: 100%" header-row-class-name="headerClassName">
          <el-table-column prop="date" label="日期">
            
          </el-table-column>
          <el-table-column prop="name" label="等级1" >
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="等级2">
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="date" label="等级3" >
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="等级4" >
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="等级5">
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="date" label="等级6" >
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="等级7">
            <template slot-scope="scope">
              <el-checkbox v-model="checked"></el-checkbox>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <el-form-item class="wrap_foot">
      <el-button type="primary" @click="onSubmit">保存</el-button>
      <el-button>取消</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  props: {
    isEdit: {
      // 分为两种模式，true为编辑模式，false为新增模式
      type: Boolean,
      default: false
    },
    abnormalInfo: {
      type: Object,
      default: function() {
        return {};
      }
    }
  },
  data() {
    return {
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: ""
      },
      conditionNum: 0,
      tableData: [{
          date: '计量异常',
          name: '王小虎',
          address: '上海市'
        }, {
          date: '网络断线',
          name: '王小虎',
          address: '上海市'
        }],
        checked: true
    };
  },
  mounted() {},
  beforeDestroy() {},
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    addCondition() {
      this.conditionNum++;
    }
  }
};
</script>
<style lang="scss" scoped>
.abnormal_notic_cmp{
  .form_head {
    font-size: 16px;
    color: #1890ff;
    padding: 10px 10px;
  }
  .abnormal_info_config {
    padding: 10px 20px;

    .abnormal_info_config_item {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
    }

    el-form-item {
      width: 300px;
    }
  }
  .abnormal_info_config_itemArea {
    .el-form-item {
      width: 75%;
    }
  }
  .wrap_head {
    position: relative;
    padding-left: 10px;
    i:nth-child(1) {
      display: inline-block;
      width: 3px;
      height: 20px;
      background: #1890ff;
      position: relative;
      top: 3px;
    }
    span {
      line-height: 20px;
    }
    i.add {
      float: right;
      margin-right: 20%;
      border: 1px solid #ccc;
      cursor: pointer;
    }
  }
  .wrap_foot {
    padding-left: 38%;
  }
  .abnormal_info_notice{
    width: 94%;
    margin-left: 3%;
    margin-bottom: 20px;
  }
}
</style>
<style lang="scss">
.abnormal_notic_cmp{
  tr.headerClassName{
    background-color: #effaff;
    th{
      background-color: #effaff;
      color: #000;
      text-align: center;
    }
  }
  tbody tr td:first-child{
    background-color: #effaff !important;
      color: #000;

      &:hover{
        background-color: #effaff !important;
        color: #000 !important;
      }
  }
  tbody tr td{
    text-align: center !important;
  }
  tbody tr{
    background: #fff;
    &:hover{
      td:first-child(1) {
        background-color: #effaff;
      }
    }
  }
}
  
</style>
